import type { CardDetail, CardListData, CardListParams, CardParams, CarListData, CarListParams, RuleListData, RuleListParams } from "@/types/card";
import type { EnterpriseListData, EnterpriseListParams, Industry } from "@/types/enterprise";
import { request } from "@/utils/reuqest";


 export const getCardListAPI=(params:CardListParams)=>{
    return  request<CardListData>('/parking/card/list', 'GET', params)
}


// 添加月卡
export const createCardAPI = (params: Partial<CardParams>) => {
   return request('/parking/card', 'POST', params)
 }

// 删除接口

export  const  delCardAPI=(ids:number[])=>{
  return request(`parking/card/${ids.join(',')}`, 'DELETE' )
  
}

// 企业管理

export const getEnterpriseListAPI=(params:EnterpriseListParams)=>{
  return request<EnterpriseListData>('/park/enterprise', 'GET',params )
}

// 企业类型
export const  getIndustryListAPI=()=>{
  return request<Industry[]>('/park/industry')
}


// 月卡编辑
export  const  getDetailDataAPI=(id:string)=>{
  return request<CardDetail>(`/parking/card/detail/${id}`)
}


// 行车计费列表

export const getRuleListAPI = (params: RuleListParams) => {
  return request<RuleListData>('/parking/rule/list', 'GET', params)
}


// 删除计费数据
export const  delRuleAPI=(id:number)=>{
  return request(`/parking/rule/${id}`, 'DELETE')
}